package com.zyong.design.pattern.visitor.case1;

/**
 * @program: zyong-design-pattern
 * @ClassName: Client
 * @author: zyong
 * @create: 2024-03-28 23:32
 */
public class Client {
    public static void main(String[] args) {
        ConcreteElementA concreteElementA = new ConcreteElementA("zhangsan");
        ConcreteElementB concreteElementB = new ConcreteElementB(20);

        ObjectStructure objectStructure = new ObjectStructure();
        objectStructure.addElement(concreteElementA);
        objectStructure.addElement(concreteElementB);

        objectStructure.accept(new ConcreteVisitor());
    }
}
